/* 全局加载指示器 */
.global-loading {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    z-index: 9999;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示样式 */
.custom-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: white;
    color: #333;
    padding: 12px 24px;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    min-width: 200px;
    max-width: 400px;
}

.custom-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.custom-message-success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.custom-message-error {
    background: linear-gradient(135deg, #f44336, #da190b);
    color: white;
}

.custom-message-warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.custom-message-info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.message-icon {
    margin-right: 8px;
    font-weight: bold;
}

.custom-message-success .message-icon:before {
    content: "✓";
}

.custom-message-error .message-icon:before {
    content: "✗";
}

.custom-message-warning .message-icon:before {
    content: "⚠";
}

.custom-message-info .message-icon:before {
    content: "ℹ";
}

/* 确认对话框样式 */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.custom-confirm {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: confirmSlideIn 0.3s ease;
}

@keyframes confirmSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.confirm-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.confirm-message {
    font-size: 16px;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 80px;
}

.cancel-btn {
    background: #f5f5f5;
    color: #666;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

.confirm-btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.confirm-btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
}

/* 按钮悬停效果 */
.nav-span:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 5px 10px;
    transition: all 0.3s ease;
}

/* 表单输入框美化 */
input[type="text"], input[type="password"] {
    transition: all 0.3s ease;
    border: 2px solid #e0e0e0 !important;
}

input[type="text"]:focus, input[type="password"]:focus {
    border-color: #007bff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1) !important;
    outline: none !important;
}

/* 按钮美化 */
button {
    transition: all 0.3s ease;
    cursor: pointer;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 卡片阴影效果 */
.container > .left > .card,
.container > .right {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.container > .left > .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 博客列表项美化 */
.blog {
    transition: all 0.3s ease;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.8);
}

.blog:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        width: 95%;
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 50px);
    }
    
    .container > .left {
        width: 100%;
        height: auto;
        margin-bottom: 20px;
    }
    
    .container > .right {
        width: 100%;
        height: auto;
        min-height: 400px;
    }
    
    .nav {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
    }
    
    .nav > .space {
        width: 20%;
    }
    
    .login-dialog {
        width: 90%;
        margin: 20px;
    }
    
    .custom-confirm {
        width: 95%;
        margin: 20px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* 暗黑模式样式 */
.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    color: #e0e6ed !important;
}

.dark-mode .nav {
    background: rgba(0, 0, 0, 0.3) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.dark-mode .container > .left > .card,
.dark-mode .container > .right {
    background: rgba(30, 39, 54, 0.95) !important;
    color: #e0e6ed !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.dark-mode .login-dialog {
    background: rgba(30, 39, 54, 0.95) !important;
    color: #e0e6ed !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.dark-mode .content-edit {
    background: rgba(30, 39, 54, 0.95) !important;
    color: #e0e6ed !important;
}

.dark-mode input[type="text"],
.dark-mode input[type="password"],
.dark-mode input[type="url"] {
    background: rgba(45, 55, 72, 0.8) !important;
    color: #e0e6ed !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.dark-mode input[type="text"]:focus,
.dark-mode input[type="password"]:focus,
.dark-mode input[type="url"]:focus {
    background: rgba(45, 55, 72, 1) !important;
    border-color: #4299e1 !important;
}

.dark-mode .blog {
    background: rgba(45, 55, 72, 0.8) !important;
    color: #e0e6ed !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.dark-mode .blog:hover {
    background: rgba(45, 55, 72, 1) !important;
}

.dark-mode .right .content .detail {
    background: rgba(45, 55, 72, 0.8) !important;
    color: #e0e6ed !important;
}

.dark-mode .right .content .title {
    color: #90cdf4 !important;
}

.dark-mode .right > .blog > .title {
    color: #90cdf4 !important;
}

.dark-mode .custom-message {
    background: rgba(45, 55, 72, 0.95) !important;
    color: #e0e6ed !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.dark-mode .custom-confirm {
    background: rgba(30, 39, 54, 0.98) !important;
    color: #e0e6ed !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* 暗黑模式切换按钮 */
.dark-mode-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    width: 45px;
    height: 25px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.dark-mode-toggle .moon-icon,
.dark-mode-toggle .sun-icon {
    font-size: 12px;
    transition: all 0.3s ease;
    position: absolute;
}

.dark-mode .dark-mode-toggle .moon-icon {
    opacity: 0;
    transform: translateY(-20px);
}

.dark-mode .dark-mode-toggle .sun-icon {
    opacity: 1;
    transform: translateY(0);
}

.dark-mode-toggle .moon-icon {
    opacity: 1;
    transform: translateY(0);
}

.dark-mode-toggle .sun-icon {
    opacity: 0;
    transform: translateY(20px);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* 页面加载进度条 */
.page-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #28a745, #ffc107);
    z-index: 10002;
    transition: width 0.3s ease;
}

.page-progress.complete {
    width: 100%;
}

/* 动画增强 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* 增强的输入框效果 */
input[type="text"]:not(:placeholder-shown),
input[type="password"]:not(:placeholder-shown),
input[type="url"]:not(:placeholder-shown) {
    border-color: #28a745 !important;
}

/* 更好的选择效果 */
::selection {
    background: rgba(0, 123, 255, 0.3);
    color: inherit;
}

.dark-mode ::selection {
    background: rgba(66, 153, 225, 0.5);
}

/* 增强的卡片悬停效果 */
.container > .left > .card {
    position: relative;
    overflow: hidden;
}

.container > .left > .card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
    opacity: 0;
}

.container > .left > .card:hover::before {
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    0% {
        opacity: 0;
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}